﻿using System.Web;
using System.Web.Security;
using Dogshow.Web.Models;

namespace Dogshow.Web.Helpers
{
    public static class CookiesHelpers
    {
         public static Korisnik VratiKorisnika(this HttpCookieCollection cookies)
         {
             var userDataValue = cookies[FormsAuthentication.FormsCookieName].Value;
             var userData = FormsAuthentication.Decrypt(userDataValue).UserData;
             var data = userData.Split('|');
             return new Korisnik(data);
         }
    }
}